<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>搜索</title>
    <link rel="stylesheet" href="../plugins/element-ui_2.14.1.css">
    <link rel="stylesheet" href="../assests/base.css">
    <link rel="stylesheet" href="../assests/headerall.css">
    <link rel="stylesheet" href="../assests/footerwhite.css">
    <link rel="stylesheet" href="../css/search.css">
    <script src="../plugins/vue_2.5.2.js"></script>
    <script src="../plugins/element-ui_2.14.1.js"></script>
    <script src="../components/headerall.js"></script>
    <script src="../components/footerwhite.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <style>
        .hide{
            display: none;
        }
    </style>
</head>
<body>
<div id="pc">
    <div id="searchResult">
        <!--头部-->
        <headerall :activeindex='activeNum'></headerall>
         <div class="result-content">
             <p class="result-text f14">为您找到以下搜索结果</p>
             <ul class="productlist-product clearfix" id="policyList">

                 <!--写死一个产品列表-->
                 <li class="productlist-product-item clearfix template hide" >
                     <div class="productlist-product-img">
                         <img  alt="" class="listImg">
                     </div>
                     <div class="productlist-product-desc">
                         <p class="productlist-product-desc-title listTilte"></p>
                         <div class="productlist-product-content-box">
                             <ul class="productlist-product-ensure-box" >
                             </ul>
                             <p class="productlist-product-year">
                                 <span >保障期限：<span class="listdate"></span>年</span>
                                 <span>投保年龄：<span class="listage"></span>周岁</span>
                             </p>
                             <ul class="productlist-product-deati-box">
                                 <!--<li class="productlist-product-money ">-->
                                 <!--<span class="productlist-product-deati-point"></span>-->
                                 <!--<span >一般医疗保险金</span>-->
                                 <!--<span class="productlist-product-deati-money">300万</span>-->
                                 <!--</li>-->
                                 <!--<li class="productlist-product-money ">-->
                                 <!--<span class="productlist-product-deati-point"></span>-->
                                 <!--<span >轻症疾病保险金</span>-->
                                 <!--<span class="productlist-product-deati-money">20万</span>-->
                                 <!--</li>-->
                                 <!--<li class="productlist-product-money ">-->
                                 <!--<span class="productlist-product-deati-point"></span>-->
                                 <!--<span >中症疾病保险金</span>-->
                                 <!--<span class="productlist-product-deati-money">5000元</span>-->
                                 <!--</li>-->
                             </ul>
                         </div>
                         <div class="productlist-btn-box">
                             <p class="productlist-btn-box-price">
                                 <span class="f14">¥</span>
                                 <span class="f30 listprice"></span>
                                 <span class="f14">起</span>
                             </p>
                             <p class="productlist-btn" >查看详情</p>
                         </div>
                     </div>
                 </li>
             </ul>
         </div>


        <footerwhite></footerwhite>
    </div>
</div>
<!--模板 s-->
<div class="hide">
    <ul id="listDesc">
        <li class="productlist-product-ensure descconten template2">
        </li>
    </ul>
</div>
<div class="hide">
    <ul class="productlist-product-deati-box" id="listDeati">
        <li class="productlist-product-money template3" >
            <span class="productlist-product-deati-point"></span>
            <span class="deatilTitle">一般医疗保险金</span>
            <span class="productlist-product-deati-money detailPrice">300万</span>
        </li>
    </ul>
</div>
<!--模板 e-->
<script src="../components/headerslect.js"></script>
<script type="text/javascript" src="../js/search.js"></script>
<script>
    $(document).ready(function(){
        //缺少产品图片返回值
        var resultList={
            pageSize:10,
            pageIndex:1,
            total:3,
            useTime:0.014,
            useTime:'',
            data:[
                {
                    "id":486266,
                    "siteID":124,
                    "title":"华贵<font color=red>大麦</font>2020定期寿险333333",
                    "content":"免体检最高350万保额，可享定期、终身寿险转换权免体检最高350万保额，可享定期、终身寿险转换权免体检最高350万保额，可享定期、终身寿险转换权免体检最高350万保额，可享定期、终身寿险转换权免体检最高350万保额，可享定期、终身寿险转换权免体检最高350万保额，可享定期、终身寿险转换权免体检最高350万保额，可享定期、终身寿险转换权免体检最高350万保额，可享定期、终身寿险转换权",
                    "url":"/c/2020-12-08/486266.shtml",
                    "jsonLink":"/c/2020-12-08/486266.shtml",
                    "addTime":"2020-12-08 16:51:06",
                    "modifyTime":"2020-12-10 15:23:13",
                    "author":"系统管理员",
                    "source":"中国平安",
                    "catalogName":"产品中心",
                    "keyword":"",
                    "editor":"系统管理员",
                    "contentType":"Article",
                    "catalogID":"15142",
                    "catalogInnerCode":"001324",
                    "logoFile":"upload/resources/image/2020/12/08/27210_260x195.jpg",
                    "status":30,
                    "indexEnable":"Y",
                    "publishDate":"2020-12-08 16:51:29",
                    "tag":"",
                    "extend":{
                        "cpts":"100种重疾医疗0免赔/住院垫付及重疾绿通/每月低至13元起",
                        "bzqx":"1",
                        "tbnl":"0-60",
                        "bzxq":"一般医疗保险金#300万/轻症疾病保险金#3000元/中症疾病保险金#20万/",
                        "jg":"151",
                        "bxlx":"产险",
                        "bxgs":"平安保险"
                    }
                },
                {
                    "id":486269,
                    "siteID":124,
                    "title":"华贵<font color=red>大麦</font>2020定期寿险2",
                    "content":"免体检最高350万保额，可享定期、终身寿险转换权",
                    "url":"/c/2020-12-08/486269.shtml",
                    "jsonLink":"/c/2020-12-08/486269.shtml",
                    "addTime":"2020-12-08 16:51:50",
                    "modifyTime":"2020-12-09 18:41:19",
                    "author":"系统管理员",
                    "source":"中国平安",
                    "catalogName":"产品中心",
                    "keyword":"",
                    "editor":"系统管理员",
                    "contentType":"Article",
                    "catalogID":"15142",
                    "catalogInnerCode":"001324",
                    "logoFile":"upload/resources/image/2020/12/08/27211_260x195.jpg",
                    "status":30,
                    "indexEnable":"Y",
                    "publishDate":"2020-12-08 16:52:28",
                    "tag":"",
                    "extend":{
                        "cpts":"100种重疾医疗0免赔/住院垫付及重疾绿通/每月低至13元起",
                        "bzqx":"1",
                        "tbnl":"0-60",
                        "bzxq":"一般医疗保险金#300万/轻症疾病保险金#3000元/中症疾病保险金#20万/",
                        "jg":"151",
                        "bxlx":"产险",
                        "bxgs":"平安保险"
                    }
                },
            ]


        }
        ajaxGetList()

        var urlParams=parseUrlParams();
        if(!urlParams.siteID){
            urlParams.siteID=siteID;////????
        }


        //ajax获取所有的数据
        function ajaxGetList(){
         // url : 'http://183.66.65.250:{端口}/ygst/',
            $.ajax({
                url:frontAppContext + 'front/search/suggest',
                type:'GET',
                xhrFields: {
                    withCredentials: true
                },
                crossDomain: true,
                data:urlParams,
                success:function(response){
                    if(response.status===1){
                        inintlist(resultList.data)
                    }
                }
            });

        }

        //初始化列表数据
        function  inintlist(alllist){
            for (var i = 0; i < alllist.length; i++) {
                var imgUrl=alllist[i].logoFile
                var obj = alllist[i].extend;
                var $template = $("#policyList .template").clone();
                $(".listImg",$template).attr('src',imgUrl);
                $(".listTilte",$template).html(obj.title);
                var descArry=obj.cpts.split('/')
                for (var j = 0; j < descArry.length; j++) {
                    var $template2 = $("#listDesc .template2").clone();
                    $($template2).html(descArry[j]);
                    $($template2).removeClass("template2").appendTo($(".productlist-product-ensure-box",$template));
                }
                $(".listdate",$template).html(obj.date);
                $(".listage",$template).html(obj.tbnl);
                $(".listprice",$template).html(obj.jg);
                var detailArray=obj.bzxq.split('/')
                for (var n = 0; n < detailArray.length; n++) {
                    var dtailDate=detailArray[n].split('#')
                    var $template3 = $("#listDeati .template3").clone();
                    $($template3).find('.deatilTitle').html(dtailDate[0]);
                    $($template3).find('.detailPrice').html(dtailDate[1]);
                    $($template3).removeClass("template3").appendTo($(".productlist-product-deati-box",$template));
                }
                $($template).removeClass("template").removeClass("hide").addClass('listproductItem').appendTo("#policyList");
            }
            $("#productNum").html(alllist.length)
        }
        //获取url传递参数
        function parseUrlParams(){
            var urlParams ={};
            if(location.search){
                var str=decodeURI(location.search)
                //去掉?
                str=str.substring(1);
                var arr=str.split("&");
                for(var i=0;i<arr.length;i++){
                    var param=arr[i]
                    if(param.indexOf("=")){
                        var key=param.substring(0,param.indexOf("="));
                        var value=param.substring(param.indexOf("=")+1);
                        urlParams[key]=value;
                    }
                }
            }
            return urlParams;
        }


    })


</script>
</body>
</html>